﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using Microsoft.WindowsCE.Forms;

namespace smart_test
{
    public partial class Form1 : Form
    {
        private Form splash;
        public Form1(Form splashScreen)
        {
            splash = splashScreen;
            InitializeComponent();
            System.Threading.Thread.Sleep(2000);
            this.Load+=new EventHandler(Form1_Load);
            this.Paint+=new PaintEventHandler(Form1_Paint);
            
        }

        private void Form1_Load(object sender, EventArgs e)
        {
           

        }

        private void Form1_Paint(object sender, PaintEventArgs e)
        {
            if (splash != null)
            {
                // Close the splashscreen
                splash.Close();
                splash.Dispose();
                splash = null;
            }
        }

        private void btCapture_Click(object sender, EventArgs e)
        {
           // string path = GetApplicationDirectory();
            //Image img = new Bitmap(Path.Combine(path, "capture_press_button.png"));
            //btCapture.Image = img;
            //btCapture.Refresh();

            menuPanel.Visible = false;
            waitpanel.Visible = true;
            
            CaptureFrm cf = new CaptureFrm(this);
            cf.Show();
            
        }

        private string GetApplicationDirectory()
        {
            return System.IO.Path.GetDirectoryName(
                System.Reflection.Assembly.GetExecutingAssembly()
                .GetModules()[0].FullyQualifiedName);
        }

        private void btView_Click(object sender, EventArgs e)
        {
            //ViewFrm vf = new ViewFrm();
            //vf.Show();

            ReviewFrm loadFrm = new ReviewFrm();
            loadFrm.Show();
        }

        private void btView_MouseDown(object sender, MouseEventArgs e)
        {
            btViewpress.Visible = true;
        }

        private void btUpload_Click(object sender, EventArgs e)
        {
            OpenFileFrm of = new OpenFileFrm();
            of.Show();
        }

        private void btUpload_MouseDown(object sender, MouseEventArgs e)
        {
            btUploadPress.Visible = true;
        }

        private void btUpload_MouseUp(object sender, MouseEventArgs e)
        {
            btUploadPress.Visible = false;
        }

        private void btCapture_MouseUp(object sender, MouseEventArgs e)
        {
            btCapturePress.Visible = false;
        }

        private void btCapture_MouseDown(object sender, MouseEventArgs e)
        {
            btCapturePress.Visible = true;
        }

        private void btView_MouseUp(object sender, MouseEventArgs e)
        {
            btViewpress.Visible = false;
        }

        public void CloseWaitPanel()
        {
            waitpanel.Visible = false;
            waitPanel2.Visible = false;
            menuPanel.Visible = true;
        }

        public void ChangeWaitPanel()
        {
            waitpanel.Visible = false;
            waitPanel2.Visible = true;

        }

        public void ChangeWaitPanel2()
        {
            waitPanel2.Visible = false;
            waitpanel.Visible = true;
        }

        /// <summary>
        /// 종료버튼 클릭 이벤트 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btExit_Click(object sender, EventArgs e)
        {
            
            Application.Exit();
            //SystemSettings.ScreenOrientation = ScreenOrientation.Angle0;
        }

        private void btExit_MouseDown(object sender, MouseEventArgs e)
        {
            btExitPress.Visible = true;
        }

        private void btExit_MouseUp(object sender, MouseEventArgs e)
        {
            btExitPress.Visible = false;
        }

        private void btInfo_Click(object sender, EventArgs e)
        {
            AboutPanel.Visible = true;
        }

        private void btInfo_MouseDown(object sender, MouseEventArgs e)
        {
            btInfoPress.Visible = true;
        }

        private void btInfo_MouseUp(object sender, MouseEventArgs e)
        {
            btInfoPress.Visible = false;
        }

        private void btInfoClose_Click(object sender, EventArgs e)
        {
            AboutPanel.Visible = false;
        }

        private void btInfoClose_MouseDown(object sender, MouseEventArgs e)
        {
            
        }

        private void btInfoClose_MouseUp(object sender, MouseEventArgs e)
        {

        }

       
        
    }
}